package org.jeecg.modules.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.entity.vo.ContractStatisticsVo;
import org.jeecg.modules.entity.vo.CusStatisticsVo;
import org.jeecg.modules.entity.vo.PurposeStatisticsVo;
import org.jeecg.modules.service.IDbContractService;
import org.jeecg.modules.service.IDbCustomerService;
import org.jeecg.modules.service.IDbPurposeFollowUpService;
import org.jeecg.modules.service.IDbPurposeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/statistics")
@Api(tags = "营销统计")
public class StatisticsController {
    @Autowired
    private IDbCustomerService dbCustomerService;
    @Autowired
    private IDbPurposeService dbPurposeService;
    @Autowired
    IDbContractService dbContractService;
    @GetMapping("/cusStatistics")
    @ApiOperation(value = "客户新增统计")
    public Result CusStatistics(){
        CusStatisticsVo cusStatisticsVo = dbCustomerService.cusStatistics();
        return Result.OK(cusStatisticsVo);
    }
    @GetMapping("/purposeStatistics")
    @ApiOperation(value = "商机统计")
    public Result PurposeStatistics(){
        PurposeStatisticsVo purposeStatisticsVo = dbPurposeService.purposeStatistics();
        return Result.OK(purposeStatisticsVo);
    }
    @GetMapping("/contractStatistics")
    @ApiOperation(value = "合同统计")
    public Result ContractStatistice(){
        ContractStatisticsVo contractStatisticsVo = dbContractService.contractSatatistics();
        return Result.OK(contractStatisticsVo);
    }
}
